Skip to content

feat(core): update graph_mermaid.py #31577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chgjin
Copy link

@chgjin chgjin commented Jun 12, 2025

This pull request includes a refinement to the _escape_node_label function in libs/core/langchain_core/runnables/graph_mermaid.py. The change improves the handling of special characters in Mermaid syntax by expanding the regex pattern to include additional characters.

Key change:

  • libs/core/langchain_core/runnables/graph_mermaid.py: Updated the _escape_node_label function to use a more comprehensive regex pattern (mermaid_special_chars) for escaping special characters in Mermaid syntax. This ensures better compatibility and avoids issues with unsupported characters.Correct the _escape_node_label method to be compatible with multilingual title names

Correct the `_escape_node_label` method to be compatible with multilingual title names
Copy link

vercel bot commented Jun 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jul 16, 2025 3:38pm

@dosubot dosubot bot added size:XS labels Jun 12, 2025
Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed WallTime Performance Report

Merging #31577 will not alter performance

Comparing chgjin:patch-1 (85df4f2) with master (12d370a)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed Instrumentation Performance Report

Merging #31577 will not alter performance

Comparing chgjin:patch-1 (85df4f2) with master (12d370a)

Summary

✅ 14 untouched benchmarks

@mdrxy mdrxy changed the title Update graph_mermaid.py feat(core): update graph_mermaid.py Jul 16, 2025
@mdrxy mdrxy requested a review from eyurtsev as a code owner July 16, 2025 15:37
Copy link
Collaborator

@mdrxy mdrxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be worried about removing all non-alphanumerics (including Unicode) but since this is scoped to mermaid and private it LGTM. cc: @eyurtsev for final approval

@mdrxy
Copy link
Collaborator

mdrxy commented Jul 16, 2025

@chgjin can you update test_graph_mermaid_escape_node_label to pass the test to reflect the new foo_bar? see this

@mdrxy mdrxy assigned mdrxy and eyurtsev and unassigned mdrxy Jul 16, 2025
@mdrxy mdrxy added the waiting-on-author PR Status: Confirmation from author is required label Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-author PR Status: Confirmation from author is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants